//
//  UIView+Frame.m
//  01-UIView、UIWindow
//
//  Created by 韩旭 on 16/7/14.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "UIView+Frame.h"
@implementation UIView (Frame)
- (void)setCenterX:(CGFloat)centerX
{
    CGPoint center = self.center;
    center.x = centerX;
    self.center = center;
}

- (CGFloat)centerX {
    return self.center.x;
}
- (void)setCenterY:(CGFloat)centerY {
    CGPoint center = self.center;
    center.y = centerY;
    self.center = center;
}
- (CGFloat)centerY {
    return self.center.y;
}
- (void)setHX_x:(CGFloat)HX_x {
    CGRect rect = self.frame;
    rect.origin.x = HX_x;
    self.frame = rect;
}
- (CGFloat)HX_x {
    return self.frame.origin.x;
}

- (void)setHX_y:(CGFloat)HX_y {
    CGRect rect = self.frame;
    rect.origin.y = HX_y;
    self.frame = rect;
}
- (CGFloat)HX_y {
    return self.frame.origin.y;
}
- (void)setHX_width:(CGFloat)HX_width {
    CGRect rect = self.frame;
    rect.size.width = HX_width;
    self.frame = rect;
}
- (CGFloat)HX_width {
    return self.frame.size.width;
}
- (void)setHX_height:(CGFloat)HX_height {
    CGRect rect = self.frame;
    rect.size.height = HX_height;
    self.frame = rect;
}
- (CGFloat)HX_height {
    return self.frame.size.height;
}

@end
